package com.tengju.data.infrastructure.repository.convert;

import com.tengju.data.domain.model.activity.SaleSituation;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.ReportActivitySaleMoneyDO;

public class BigDataActivitySaleMoneyConvert {

    private BigDataActivitySaleMoneyConvert() {
    }

    public static SaleSituation convertToModel(ReportActivitySaleMoneyDO bigDataActivitySaleMoneyDO) {

        if (bigDataActivitySaleMoneyDO == null) {
            return null;
        }

        return new SaleSituation(
                bigDataActivitySaleMoneyDO.getTargetSaleMoney(),
                bigDataActivitySaleMoneyDO.getSaleMoney(),
                bigDataActivitySaleMoneyDO.getCompletionRate()
        );
    }
}
